<template>
  <div class="data-table">
    <el-table
      :data="value"
      :border="true"
      stripe
      size="small"
      style="width: 100%">
      <el-table-column
        type="selection"
        width="40">
      </el-table-column>
      <el-table-column
        v-for="(col, i) in columns"
        :key="i + col.field"
        :prop="col.field"
        :label="col.label"
        :width="col.width || 120">
        <template v-if="!col.type" slot-scope="scope">
          <i class="el-icon-time"></i>
          <el-input v-model="scope.row[col.field]" placeholder="请输入"></el-input>
        </template>
      </el-table-column>
      <el-table-column prop="__extend__"></el-table-column>
    </el-table>
  </div>
</template>

<script>
export default {
  props: {
    columns: {
      default () {
        return [
          {label: '键', field: 'key', width: 120},
          {label: '值', field: 'value', width: 120},
          {label: '描述', field: 'description', width: 120}
        ]
      }
    },
    value: {
      default () {
        return []
      }
    }
  },

  data () {
    return {

    }
  }
}
</script>

<style lang="less" scoped>

</style>